package com.practicesuite.systemlayer;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Patient Class
 * Patient can only be instantiated once credentials have been verified against database
 * @author Ronald Brown
 *
 */
public class Patient extends User implements Serializable{
    
    public Patient() {
        
    }
	//Vaiables
	private MedicalInformation medicalInformation;
	private boolean isLoggedIn;
	private List<TreatmentRecord> medicalHistory;
	
	/**
	 * Constructor
	 * @param name
	 * @param eUID
	 * @param userID
	 * @param dateOfBirth
	 * @param address
	 * @param phoneNumber
	 * @param gender
	 * @param age
	 * @param medicalInformation
	 */
	public Patient(String name, int eUID, int userID, Date dateOfBirth, String address, String phoneNumber, 
			String gender, int age, MedicalInformation medicalInformation, String emailAddress, boolean suspended) {
		//Call super class
		super(name, eUID, userID, dateOfBirth, address, phoneNumber, gender, age, emailAddress, suspended);
		//Associate private data with Patient
		this.medicalInformation = medicalInformation;
	}
	
	/**
	 * This can only be called from system, used to set medical history for Patient
	 * @param medicalHistory
	 */
	public void setMedicalHistory(List<TreatmentRecord> medicalHistory) {
		this.medicalHistory = medicalHistory;
		
	}

	/**
	 * Checks if the user is currently active in the system (meaning doing a task)
	 * @return
	 */
	public boolean systemLoggin() {
		return this.isLoggedIn;
	}
	
	
	public List<TreatmentRecord> getMedicalHistory() {
		return this.medicalHistory;
	}
	
	public void updateMedicalInformation(MedicalInformation medicalInformation) {
		this.medicalInformation = medicalInformation;
	}
	
	public MedicalInformation getMedicalInformation() {
		return this.medicalInformation;
	}

    @Override
    public String toString() {
        return "Patient [medicalInformation=" + medicalInformation
                + ", isLoggedIn=" + isLoggedIn + ", medicalHistory="
                + medicalHistory + "]";
    }
	
	
	
}
